Welcome to the airquality package. This package uses various data from the .

It includes various functions that help you to get an overview about the airquality in any town. You can:

In the following, each function is explained in detail and examples are provided.

How to Install the Airquality Package

#github_install can only be added when the week 3 branch is merged
#install_github('Programming-The-Next-Step-2022/airquality')

Current Airquality Data (data frame)

This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:

current_aq_df("Amsterdam", "NL")
##   Component Index / Concentration
## 1       AQI                  1.00
## 2        CO                216.96
## 3        NO                  0.64
## 4       NO2                  6.26
## 5        O3                 79.39
## 6       SO2                  2.35
## 7     PM2_5                  2.30
## 8     PM_10                  7.80
## 9       NH3                  0.97

To display the output to users in a nicer way, you can use the gt::gt() function

gt(current_aq_df())
Component Index / Concentration
AQI 1.00
CO 216.96
NO 0.64
NO2 6.26
O3 79.39
SO2 2.35
PM2_5 2.30
PM_10 7.80
NH3 0.97

Plotting the AQI for the past two weeks

This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a plot showing the average AQI per day over the last two weeks.

plot_aqi_hist("Paris", "FRA")

Plotting Air Quality Subcomponents for the Past two Weeks

This function takes the city, the country (use ISO 3166 country codes), and the desired subcomponent (e.g., co) as arguments. It outputs a plot showing the average concentration of for example carbon monoxide over the last two weeks.

plot_comp_hist("Rome", "ITA", "co")

Current AQI of the 10 largest European Cities

This function shows the current AQI in the ten largest European cities. The values are colored according the AQI.

current_aq_table()
Current Airquality Index (AQI) of Top 10 Major Europan Cities
Cities AQI
Istanbul 5
London 1
Berlin 1
Madrid 1
Kyiv 2
Rome 4
Bucharest 2
Paris 1
Vienna 1
Hamburg 2

Current Weather Data

This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:

current_weather("Berlin", "GER")
Component Data
Current Weather broken clouds
Current Temperature 14.05
Feels Like Temperature 13.76
Min Temperature 12.22
Max Temperature 15.56
Air Pressure 1004
Humidity 86
Visibility 10000
Wind Speed 4.63
Wind Direction 280
Sunrise 1653620087
Sunset 1653678763